package com.matrix.draft.jvm.lianjie;

/**
 * 类加载相关
 */
public class TestClassLoad {
    public static void main(String[] args) throws Exception {
//        Class.forName("com.matrix.draft.jvm.classloader.B");
//        ClassLoader.getSystemClassLoader().loadClass("com.matrix.draft.jvm.classloader.B");
        System.out.println(String.class.getClassLoader()); // BootstrapClassLoader
        System.out.println(E.class.getClassLoader()); // AppClassLoader
        System.out.println(ClassLoader.getSystemClassLoader()); // AppClassLoader
        System.out.println(ClassLoader.class.getClassLoader()); // BootstrapClassLoader
        System.out.println(Thread.currentThread().getContextClassLoader()); // AppClassLoader
    }


}

class E{
    public static final int a = 10;
    public static final Object obj = new Object();
    public static int b = 20;
    public static String c = "jvm";

    public static final int d;

    static {
        d= 666;
        System.out.println("cinit E");
    }
}